﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AudioCore.Common
{
    public class Constant
    {
        public const string DATABASE = "AUDIODB";

        public const int ROOT_CATEGORY_ID = 1;

        public const string DatePartSeparator = "./-";
        public const char Blank = ' ';
        public const string SeparatorCharacter = @"\";
        // The seq ID of the first MT
        public const int SeqIDOfTheFirstMT = 0;
        public const string ENDLINE_CHAR = "\n"; // Endline character
        public const string COLON_CHAR = ":";
        public const string BLANK_CHAR = " ";
        public const string HTML_BLANK_CHAR = "%20";
        public const int MAX_LENGHT_SMS = 160;
        /// <summary>
        /// ID of the Error Service that is used for dummy
        /// </summary>        
        public const int ErrorServiceID = -1;

        /// <summary>
        /// ID of the Error SubService that is used for dummy when no sub-service found.
        /// <br>Example: User send 'iXS' to 6092 => No subservice of XS for this provider</br>.
        /// <br>So use ErrorSubServiceID for write to SentItems table</br>
        /// </summary>
        public const int ErrorSubServiceID = -1;

        // 20100724 - HungBM - Add register to site process - START
        public const string WSKultechUserName = "ienter.vn";
        public const string WSKultechPassword = "ienter.vn";
        // 20100724 - HungBM - Add register to site process - END

        public const char SEPARATER_CHAR = '/';

        /// <summary>
        /// The extension of images
        /// </summary>
        public const string IMAGE_EXTENSION = ".jpg";

        /// <summary>
        /// 
        /// The extension of audio file</summary>
        public const string AUDIO_EXTENSION = ".mp3";

        public const string VIDEO_EXTENSION = ".3gp";

        /// <summary>
        /// The folder containts audio files
        /// </summary>
        public const string AUDIO_FOLDER = "Audio\\";

        /// <summary>
        /// The folder containts category images
        /// </summary>
        public const string CATEGORY_FOLDER = "Category\\";

        /// <summary>
        /// Original extension ex. 12345_org.mp3
        /// </summary>
        public const string ORIGINAL_FILE = "_org";

        /// <summary>
        /// Original bitrate
        /// </summary>
        public const int ORIGINAL_BITRATE = 64;

        /// <summary>
        /// param 0: ModuleID, param 2: ItemID, param 3: ItemType
        /// </summary>
        public const string DOWNLOAD_PARAM = "m:{0}-id:{1}-t:{2}";

        /// <summary>
        /// The ItemTypeID int table ItemType
        /// </summary>
        public enum ItemType
        {
            /// <summary>
            /// ItemTypeID of Category
            /// </summary>
            Category = 1,

            /// <summary>
            /// ItemTypeID of Article
            /// </summary>
            Article = 2,

            /// <summary>
            /// ItemTypeID of ArticlePart
            /// </summary>
            ArticlePart = 3
        }

        /// <summary>
        /// Defines return value for a logging in request.
        /// </summary>
        public enum AccountLoginResult
        {
            Success = 0,
            UserIsNotExist = 1,
            Failed = 2
        }

        /// <summary>
        /// Defines return value for a registering request.
        /// </summary>
        public enum AccountRegisterResult
        {
            Success = 0,
            UserNameIsExist = 1,
            Failed = 2
        }

        /// <summary>
        /// The status of physical file of the server
        /// </summary>
        public enum FileStatus
        {
            /// <summary>
            /// The physical file is being added
            /// </summary>
            Adding = 1,

            /// <summary>
            /// The physical file is being deleted
            /// </summary>
            Deleting = 2,

            /// <summary>
            /// The physical file was added
            /// </summary>
            Added = 3
        }

        public class ConfigKey
        {
            /// <summary>
            /// The key containts path of data folder
            /// </summary>
            public const string DATA_FOLDER = "DATA_FOLDER";

            public const string TEMP_FOLDER = "TEMP_FOLDER";
            /// <summary>
            /// ServerID configuration key
            /// </summary>
            public const string SERVER_ID = "SERVER_ID";

            /// <summary>
            /// The key of mp3 cutter
            /// </summary>
            public const string MP3_CUTTER = "Mp3Cutter";
        }

        public static class TraceSourceName
        {
            public const string General = "AudioBook";
        }

        /// <summary>
        /// Defines constant values in SQL Server.
        /// </summary>
        public static class SqlServer
        {
            public const int AutoIncrementIDSeedValue = 1;
            public const int MinValueDayOfWeek = 1;
            public const int MaxValueDayOfWeek = 7;
        }

        /// <summary>
        /// Defines status of get response result from services.
        /// </summary>
        public enum ResponseStatus
        {
            /// <summary>
            /// Get response result success.
            /// </summary>
            Sucsess,
            /// <summary>
            /// Response result is not avaiable.
            /// </summary>
            NoResult,
            /// <summary>
            /// Error occurs when get response result.
            /// </summary>
            Failed
        }
    }
}
